$source_file = 'foo/image.jpg'; $destination_path = 'bar/'; rename($source_file, $destination_path . pathinfo($source_file, PATHINFO_BASENAME));